package com.geely.design.pattern.creational.singleton;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ContainMain {
    public static void main(String[] args) {
        ExecutorService executorService =
                Executors.newFixedThreadPool(10);
        for(int i=0;i<10;i++){
            executorService.submit(()->{
                Object bean = ContainerSingleTest.getBean("com.geely.design.pattern.creational.factorymethod.Test");
                System.out.println("T1:"+bean.toString());
            });
        }

        System.out.println(ContainerSingleTest.getBean("com.geely.design.pattern.creational.factorymethod.Test"));
        System.out.println(ContainerSingleTest.getBean("com.geely.design.pattern.creational.factorymethod.Test"));

    }
}
